#include <bits/stdc++.h>
// 2025/04/02
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;

int n, m, dp[31][2];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    dp[0][0] = 1;
    for (int i = 1; i <= m; i++)
        for (int j = 0; j < n; j++)
            dp[j][i & 1] = dp[(j + 1) % n][!(i & 1)] + dp[(j - 1 + n) % n][!(i & 1)];
    cout << dp[0][m & 1] << endl;
    return 0;
}